#ifndef USR_INFO_H
#define USR_INFO_H

#include <QTcpSocket>

#define USERIDSIZE      20
#define USERDATASIZE    1000
#define MAXUSER         100
#define CMDSIZE         1
/* 给服务器发送的命令 */
#define CMD_LOGIN           1
#define CMD_REGISTER        2
#define CMD_USERDATA        10
#define CMD_CLOSECHAT       12

/* 服务器返回的命令 */
#define CMD_LOGINSUCCESS    3
#define CMD_REGISTERSUCCESS 4
#define CMD_LOGINFAILED     5
#define CMD_REGISTERFAILED  6
#define CMD_REGISTEREXISTS  7
#define CMD_GetOnlineuser   8
#define CMD_Onlineuser      9
#define CMD_REPEATLOGIN     11

#define DATASIZE        CMDSIZE + USERIDSIZE*2 + USERDATASIZE

typedef struct user_data
{
    unsigned char cmd;
    char dst_id[USERIDSIZE];
    char src_id[USERIDSIZE];
    char data[USERDATASIZE];
}USER_DATA;

//typedef struct user_info
//{
//    char cmd;
//    char username[USERIDSIZE];
//    char passwd[USERIDSIZE];
//}USER_INFO;

//extern USER_INFO user_info;
#endif // USR_INFO_H

